import request from '@/utils/request'

// 角色
export const sysRoleList = data => {
    return request({
        url: '/system-server/sysRole/list',
        method: 'get',
        params: data
    })
}

export const sysRoleAdd = data => {
    return request({
        url: '/system-server/sysRole/add',
        method: 'post',
        data
    })
}

export const sysRoleUpdate = data => {
    return request({
        url: '/system-server/sysRole/update',
        method: 'post',
        data
    })
}

export const sysRoleDel = data => {
    return request({
        url: '/system-server/sysRole/batchRemove',
        method: 'post',
        data
    })
}

export const sysRoleQueryById = data => {
    return request({
        url: '/system-server/sysRole/queryById',
        method: 'get',
        params: data
    })
}

// 菜单资源
export const sysResourceAdd = data => {
    return request({
        url: '/system-server/sysResource/add',
        method: 'post',
        data
    })
}

export const sysResourceUpdate = data => {
    return request({
        url: '/system-server/sysResource/update',
        method: 'post',
        data
    })
}

export const sysResourceDel = data => {
    return request({
        url: '/system-server/sysResource/batchRemove',
        method: 'post',
        data
    })
}

export const sysResourceList = data => {
    return request({
        url: '/system-server/sysResource/list',
        method: 'get',
        params: data
    })
}

export const sysResourceAllTreeForSelect = data => {
    return request({
        url: '/system-server/sysResource/allTreeForSelect',
        method: 'get',
        params: data
    })
}

export const sysResourceLazyTree = data => {
    return request({
        url: '/system-server/sysResource/lazyTree',
        method: 'get',
        params: data
    })
}

export const queryResourcesByRoleId = data => {
    return request({
        url: '/system-server/sysRoleResource/queryResourcesByRoleId',
        method: 'get',
        params: data
    })
}

export const saveRoleResources = data => {
    return request({
        url: '/system-server/sysRoleResource/saveRoleResources',
        method: 'post',
        data
    })
}

// 门店管理
export const sysOrganizationAdd = data => {
    return request({
        url: '/system-server/sysOrganization/add',
        method: 'post',
        data
    })
}

export const sysOrganizationDel = data => {
    return request({
        url: '/system-server/sysOrganization/batchRemove',
        method: 'post',
        data
    })
}

export const sysOrganizationList = data => {
    return request({
        url: '/system-server/sysOrganization/list',
        method: 'get',
        params: data
    })
}

export const sysOrganizationListByParentId = data => {
    return request({
        url: '/system-server/sysOrganization/listByParentId',
        method: 'get',
        params: data
    })
}

export const sysOrganizationUpdate = data => {
    return request({
        url: '/system-server/sysOrganization/update',
        method: 'post',
        data
    })
}

export const sysOrganizationQueryById = data => {
    return request({
        url: '/system-server/sysOrganization/queryById',
        method: 'get',
        params: data
    })
}

export const sysRegionListByParentCode = data => {
    return request({
        url: '/system-server/sysRegion/listByParentCode',
        method: 'get',
        params: data
    })
}

export const sysOrganizationListForSelect = data => {
    return request({
        url: '/system-server/sysOrganization/listForSelect',
        method: 'get',
        params: data
    })
}

export const getSupplierListByRegion = data => {
    return request({
        url: '/system-server/sysOrganization/findSupplierListByRegionCode',
        method: 'get',
        params: data
    })
}

// 门店技能类别
export const storeSkillTypeAdd = data => {
    return request({
        url: '/system-server/storeSkillType/add',
        method: 'post',
        data
    })
}

export const storeSkillTypeDel = data => {
    return request({
        url: '/system-server/storeSkillType/batchRemove',
        method: 'post',
        data
    })
}

export const storeSkillTypeList = data => {
    return request({
        url: '/system-server/storeSkillType/page',
        method: 'get',
        params: data
    })
}

export const storeSkillTypeQueryById = data => {
    return request({
        url: '/system-server/storeSkillType/queryById',
        method: 'get',
        params: data
    })
}

export const storeSkillTypeUpdate = data => {
    return request({
        url: '/system-server/storeSkillType/update',
        method: 'post',
        data
    })
}

export const storeSkillTypeLevelList = data => {
    return request({
        url: '/system-server/storeSkillType/skillLevel/list',
        method: 'get',
        params: data
    })
}

export const storeSkillTypeLevelSave = data => {
    return request({
        url: '/system-server/storeSkillType/skillLevel/save',
        method: 'post',
        data
    })
}

export const storeSkillTypeLevelDel = data => {
    return request({
        url: '/system-server/storeSkillType/skillLevel/remove',
        method: 'post',
        data
    })
}

export const storeSkillTypeAllTree = data => {
    return request({
        url: '/system-server/sysSkillType/allTree',
        method: 'get',
        params: data
    })
}

export const storeSkillTypeLazyTree = data => {
    return request({
        url: '/system-server/sysSkillType/lazyTree',
        method: 'get',
        params: data
    })
}

export const findListForSelect = data => {
    return request({
        url: '/system-server/storeSkillType/findListForSelect',
        method: 'get',
        params: data
    })
}

export const findSkillLevelList = data => {
    return request({
        url: '/system-server/storeSkillType/findSkillLevelList',
        method: 'get',
        params: data
    })
}

// 门店用户
export const sysUserList = data => {
    return request({
        url: '/system-server/sysUser/list',
        method: 'get',
        params: data
    })
}

export const sysUserAdd = data => {
    return request({
        url: '/system-server/sysUser/add',
        method: 'post',
        data
    })
}

export const sysUserDel = data => {
    return request({
        url: '/system-server/sysUser/batchRemove',
        method: 'post',
        data
    })
}

export const sysUserQueryById = data => {
    return request({
        url: '/system-server/sysUser/queryById',
        method: 'get',
        params: data
    })
}

export const sysUserUpdate = data => {
    return request({
        url: '/system-server/sysUser/update',
        method: 'post',
        data
    })
}

export const findAllBusinessRoleForSelect = data => {
    return request({
        url: '/system-server/sysRole/findAllBusinessRoleForSelect',
        method: 'get',
        params: data
    })
}

export const checkLoginNameIsExists = data => {
    return request({
        url: '/system-server/sysUser/checkLoginNameIsExists',
        method: 'get',
        params: data
    })
}

export const seDefaultPwd = data => {
    return request({
        url: '/system-server/sysUser/seDefaultPwd',
        method: 'post',
        data
    })
}

export const changeStatus = data => {
    return request({
        url: '/system-server/sysUser/changeStatus',
        method: 'post',
        data
    })
}

export const findNearByStoreList = data => {
    return request({
        url: '/system-server/store-emp-business/findNearByStoreList',
        method: 'get',
        params: data
    })
}

export const findEmpListByStoreId = data => {
    return request({
        url: '/system-server/store-emp-business/findEmpListByStoreId',
        method: 'get',
        params: data
    })
}


export const findCustomerListForStore = data => {
    return request({
        url: '/system-server/customerBusiness/findCustomerListForStore',
        method: 'get',
        params: data
    })
}

export const findTechnicianList = data => {
    return request({
        url: '/system-server/sysEmpSkill/findTechnicianList',
        method: 'get',
        params: data
    })
}


export const sysMechanicInfoList = data => {
    return request({
        url: '/system-server/sysMechanicInfo/list',
        method: 'get',
        params: data
    })
}

export const sysMechanicInfoSave = data => {
    return request({
        url: '/system-server/sysMechanicInfo/save',
        method: 'post',
        data
    })
}

export const sysMechanicInfoUpdate = data => {
    return request({
        url: '/system-server/sysMechanicInfo/update',
        method: 'post',
        data
    })
}

export const sysMechanicInfoFindById = data => {
    return request({
        url: '/system-server/sysMechanicInfo/findById',
        method: 'get',
        params: data
    })
}

export const sysMechanicInfoBatchRemove = data => {
    return request({
        url: '/system-server/sysMechanicInfo/batchRemove',
        method: 'post',
        data
    })
}

export const sysMechanicInfoBatchChangeStatus = data => {
    return request({
        url: '/system-server/sysMechanicInfo/changeStatus',
        method: 'post',
        data
    })
}